package com.example.reggie.common;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 老肥！！！
 * @Date: 2022/09/13/20:28
 * @Description: 不想学代码了！！！
 */
//      基于ThreadLocal封装工具类，用于保存和获取当前登录用户id
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

//    设置值
    public static void setCurrentID(Long id){
        threadLocal.set(id);
    }
//      获取值
    public static Long getCurrentID(){
        return threadLocal.get();
    }
}
